1 //--------------------------------------------------------------------------
3 // Copyright (c) Microsoft Corporation. All rights reserved.
7 // Description: A panel used to render a double-buffered image.
9 //--------------------------------------------------------------------------
11 using System
.ComponentModel
;
13 using System
.Windows
.Forms
;
15 namespace Microsoft
.ParallelComputingPlatform
.ParallelExtensions
.Samples
.Sudoku
.Controls
17 /// <summary>Double-buffered panel that displays a stretched image.</summary>
18 internal class ImagePanel
: NoFlickerPanel
20 /// <summary>Initializes the panel.</summary>
23 /// <summary>The image to be rendered.</summary>
26 /// <summary>Gets or sets the image to be rendered.</summary>
27 [DesignerSerializationVisibility(DesignerSerializationVisibility
.Hidden
)]
29 public Image Image { get { return _img; }
set { _img = value; }
}
31 /// <summary>Paints the image.</summary>
32 /// <param name="e">Paint event args.</param>
33 protected override void OnPaint(PaintEventArgs e
)
37 e
.Graphics
.DrawImage(_img
, 0, 0, Width
, Height
);